<?php

use Illuminate\Routing\Router;

Admin::routes();

Route::group([
    'prefix'        => config('admin.route.prefix'),
    'namespace'     => config('admin.route.namespace'),
    'middleware'    => config('admin.route.middleware'),
], function (Router $router) {

    $router->get('/', 'HomeController@index')->name('admin.home');
    #  地址数据包
    $router->get('region/refresh', "System\\RegionController@refresh" );
    $router->resource('region', System\RegionController::class);

    $router->group([
        'namespace' => 'User',
        'prefix' => 'user',
    ], function(Router $router){
        $router->resource('system-users', SystemUserController::class);
        $router->resource('user-walletrecords', WalletController::class);
    });

    $router->group([
        'namespace' => 'System',
        'prefix' => 'system',
    ], function(Router $router){
        $router->resource('share-background-imgs', ShareBackgroundImgController::class);
    });
    $router->group([
        'namespace' => 'Shop',
        'prefix' => 'shop',
    ], function(Router $router){
        $router->resource('goods-classes', GoodsClassController::class);
        $router->resource('goods', GoodsController::class);
    });

    $router->any('/api/users', 'ApiController@users');
    $router->any('/api/upload', 'ApiController@upload');

    #公共参数；
    $router->resource('common-params', Common\ParamsController::class);

    # 房屋
    $router->resource('houses', House\HouseController::class);

    $router->resource('dog-merchants', Dog\DogmerController::class);

    $router->resource('dog-owners', Dog\DoguserController::class);
});
